package com.link.play.fit.ai

import android.app.Application
import android.content.Context
import com.link.play.fit.ai.ad.AdmobHelper
import com.link.play.fit.ai.kv.AuthCache
import com.link.play.fit.ai.kv.AuthCache.isVip
import com.link.play.fit.ai.kv.KVStore
import com.link.play.fit.ai.ui.main.GlobalViewModel
import com.link.play.fit.ai.utils.AppX
import com.link.play.fit.ai.utils.DeviceHelps
import com.link.play.fit.ai.utils.FirebaseUtils
import com.link.play.fit.ai.utils.GooglePayUtil
import com.link.play.fit.ai.utils.RetrofitClient

/**
 *Create by SleepDog on 2025-03-24
 */
class MyApp : Application() {

    override fun attachBaseContext(base: Context?) {
        super.attachBaseContext(base)
        AppX.applicationContext = this
        KVStore.init(this)
        RetrofitClient.init(GlobalConfig.URL_API)
//        isVip = true
    }

    override fun onCreate() {
        super.onCreate()
        if (!isVip) {
           // AdmobHelper.initAdmob(this)
        }
        DeviceHelps.init()
//        GooglePayUtil.startConnection()
        GlobalViewModel.getInstance(this)
//        RemoteConfig.init()
        FirebaseUtils.initFirebase()
//        InAppPurchaseUtil.initialize()


        //InstallReferrerHelps.init()
    }
}